<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="favicon.ico">

    <title>m4b-tool - a tool to merge, split or and manipulate m4b audiobooks with chapters</title>

    <!-- Bootstrap core CSS -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet">

    <style>
        body {
            padding-top: 5rem;
        }

        pre, code {
            padding: 5px;
            background: silver;
        }

        pre {
            border: 1px solid #666;
        }
    </style>
</head>

<body>

<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
    <a class="navbar-brand" href="#">m4b-tool</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault"
            aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse" id="navbarsExampleDefault">
        <ul class="navbar-nav mr-auto">
            <li class="nav-item">
                <a class="nav-link" href="#m4b-tool">Home</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#contact">Contact</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="https://github.com/sandreas/m4b-tool" target="_blank">Github</a>
            </li>
        </ul>
    </div>
</nav>

<main role="main" class="container">
    <a name="m4b-tool"></a>
    <div class="m4b-tool">
        <article class="markdown-body entry-content p-5" itemprop="text">
            <h1>
                <a id="user-content-m4b-tool" class="anchor" aria-hidden="true" href="#m4b-tool">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>m4b-tool
            </h1>
            <p><code>m4b-tool</code> is a is a wrapper for <code>ffmpeg</code> and <code>mp4v2</code> to merge, split or
                and manipulate audiobook files with chapters. Although <code>m4b-tool</code> is designed to handle m4b
                files, nearly all audio formats should be supported, e.g. mp3, aac, ogg, alac and flac.</p>
            <h2>
                <a id="user-content-features" class="anchor" aria-hidden="true" href="#features">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Features
            </h2>
            <ul>
                <li>
                    <code>merge</code> a set of audio files (e.g. MP3 or AAC) into a single m4b file
                </li>
                <li>
                    <code>split</code> a single m4b file into several output files by chapters
                </li>
                <li>Add or adjust <code>chapters</code> for an existing m4b file via silence detection or musicbrainz
                </li>
            </ul>
            <h2>
                <a id="user-content-tldr---examples-for-the-most-common-tasks" class="anchor" aria-hidden="true"
                   href="#tldr---examples-for-the-most-common-tasks">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>TL;DR - examples for the most common tasks
            </h2>
            <blockquote>
                <p><code>merge</code> all audio files in directory <code>data/my-audio-book</code> into file <code>data/merged.m4b</code>
                    (tags are retained and <code>data/my-audio-book/cover.jpg</code> and <code>data/my-audio-book/description.txt</code>
                    are embedded, if available)</p>
            </blockquote>
            <pre><code>m4b-tool merge "data/my-audio-book/" --output-file="data/merged.m4b"
</code></pre>
            <blockquote>
                <p><code>split</code> one big m4b file by chapter into multiple mp3 files at <code>data/my-audio-book_splitted/</code>
                    (tags are retained, <code>data/my-audio-book_splitted/cover.jpg</code> is created, if m4b contains a
                    cover)</p>
            </blockquote>
            <pre><code>m4b-tool split --audio-format mp3 --audio-bitrate 96k --audio-channels 1 --audio-samplerate 22050 "data/my-audio-book.m4b"
</code></pre>
            <blockquote>
                <p><code>chapters</code> can try to adjust existing chapters of an m4b by silence detection</p>
            </blockquote>
            <pre><code>m4b-tool chapters --adjust-by-silence -o "data/destination-with-adjusted-chapters.m4b" "data/source-with-misplaced-chapters.m4b"
</code></pre>
            <h2>
                <a id="user-content--request-for-help---especially-german-users" class="anchor" aria-hidden="true"
                   href="#-request-for-help---especially-german-users">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a><a target="_blank" rel="noopener noreferrer"
                       href="https://camo.githubusercontent.com/71cd3853e7fb625128012988c113bceba7ccbfdc/68747470733a2f2f706c616365686f6c642e69742f31352f6630336331352f3030303030303f746578743d2b"><img
                    src="https://camo.githubusercontent.com/71cd3853e7fb625128012988c113bceba7ccbfdc/68747470733a2f2f706c616365686f6c642e69742f31352f6630336331352f3030303030303f746578743d2b"
                    alt="#f03c15" data-canonical-src="https://placehold.it/15/f03c15/000000?text=+"
                    style="max-width:100%;"></a> Request for help - especially german users
            </h2>
            <p>Right now, I'm experimenting with speech recognition and <em>speech to text</em> using <a
                    href="https://github.com/gooofy/zamia-speech">this project</a></p>
            <p>This is for a feature to automatically add chapter names by speech recognition. I'm not sure this will be
                ever working as expected, but right now I'm pretty confident, it is possible to do the following, if
                there are enough speech samples in a specific language:</p>
            <ul>
                <li>Extract chapter names and first sentences of a chapter from an ebook</li>
                <li>Detect all silences in the audiobook</li>
                <li>Perform a speech to text for the first 30 seconds after the silence</li>
                <li>Compare it with the text parts of the ebook, mark the chapter positions and add real chapters
                    names
                </li>
            </ul>
            <p>To do that and improve the german speech recognition, I would really appreciate <em>YOUR</em> help on:
            </p>
            <p><strong><a href="https://voice.mozilla.org/de" rel="nofollow">https://voice.mozilla.org/de</a>
                (german)</strong></p>
            <blockquote>
                <p>No account is needed to help</p>
            </blockquote>
            <p>You can support mozilla DeepSpeech to better support german speech recognition by just verifying
                sentences after listening or, even more important, reading out loud and uploading sentences. I try to
                add a few ones every day, its really easy and quite fun. At the moment the german speech recognition is
                not good enough for the algorithm, but I will check out every now and then - as soon the recognition is
                working good enough, I'll go on with this feature.</p>
            <h2>
                <a id="user-content-best-practices" class="anchor" aria-hidden="true" href="#best-practices">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Best practices
            </h2>
            <p>Since the most used subcommand of <code>m4b-tool</code> seems to be <code>merge</code>, lets talk about
                best practice...</p>
            <h3>
                <a id="user-content-step-0---take-a-look-at-the-docker-image---even-if-its-experimental" class="anchor"
                   aria-hidden="true" href="#step-0---take-a-look-at-the-docker-image---even-if-its-experimental">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Step 0 - Take a look at the docker image - even if its experimental
            </h3>
            <p>Unfortunately <code>m4b-tool</code> has many dependencies. Not only one-liners, if you would like to get
                the best quality and tagging support, many dependencies have to be compiled manually with extra options.
                Thats why you should take a look at the <a href="#docker-experimental">docker image</a>, which comes
                with all the bells and whistles of top audio quality, top tagging support and easy installation and has
                almost no disadvantages.</p>
            <blockquote>
                <p>Note: If you are on windows, it might be difficult to make it work</p>
            </blockquote>
            <h3>
                <a id="user-content-step-1---organizing-your-audiobooks-in-directories" class="anchor"
                   aria-hidden="true" href="#step-1---organizing-your-audiobooks-in-directories">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Step 1 - Organizing your audiobooks in directories
            </h3>
            <p>When merging audiobooks, you should prepare them - the following directory structure helps a lot, even if
                you only merge one single audiobook:</p>
            <p><code>input/&lt;main genre&gt;/&lt;author&gt;/&lt;title&gt;</code></p>
            <p>or if it is a series</p>
            <p><code>input/&lt;main genre&gt;/&lt;author&gt;/&lt;series&gt;/&lt;series-part&gt; - &lt;title&gt;</code>
            </p>
            <p>Examples:</p>
            <pre><code>input/Fantasy/J.K. Rowling/Quidditch Through the Ages/
input/Fantasy/J.K. Rowling/Harry Potter/1 - Harry Potter and the Philosopher's Stone/
</code></pre>
            <blockquote>
                <p>Note: If your audiobook title contains invalid path characters like <code>/</code>, just replace them
                    with a dash <code>-</code>.</p>
            </blockquote>
            <h3>
                <a id="user-content-step-2---add-cover-and-a-description" class="anchor" aria-hidden="true"
                   href="#step-2---add-cover-and-a-description">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Step 2 - add cover and a description
            </h3>
            <p>Now, because you almost always want a cover and a description for your audiobook, you should add the
                following files in the main directory:</p>
            <ul>
                <li><code>cover.jpg</code></li>
                <li>
                    <code>description.txt</code> (Be sure to use <code>UTF-8</code> text file encoding for the contents)
                </li>
            </ul>
            <p>Examples:</p>
            <pre><code>input/Fantasy/J.K. Rowling/Quidditch Through the Ages/cover.jpg
input/Fantasy/J.K. Rowling/Quidditch Through the Ages/description.txt
</code></pre>
            <blockquote>
                <p>Note: <code>m4b-tool</code> will find and embed these files automatically but does not fail, if they
                    are not present</p>
            </blockquote>
            <h3>
                <a id="user-content-step-3---chapters" class="anchor" aria-hidden="true" href="#step-3---chapters">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Step 3 - chapters
            </h3>
            <p>Chapters are nice to add <em>waypoints</em> for your audiobook. They help to remember the last position
                and improve the experience in general.</p>
            <h4>
                <a id="user-content-fixed-chapters" class="anchor" aria-hidden="true" href="#fixed-chapters">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>fixed chapters
            </h4>
            <p>If you would like to adjust chapters manually, you can add a <code>chapters.txt</code> (same location as
                <code>cover.jpg</code>) with following contents (<code>&lt;chapter-start&gt;</code> <code>&lt;chapter-title&gt;</code>):
            </p>
            <pre><code>00:00:00.000 Intro
00:04:19.153 This is
00:09:24.078 A way to add
00:14:34.500 Chapters manually
</code></pre>
            <h4>
                <a id="user-content-by-tag" class="anchor" aria-hidden="true" href="#by-tag">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>by tag
            </h4>
            <p>If your input files are tagged, these tags will be used to create the chapter metadata by its
                <code>title</code>. So if you tag your input files with valid chapter names as track <code>title</code>,
                this will result in a nice and clean <code>m4b</code>-file with valid chapter names.</p>
            <h4>
                <a id="user-content-by-length" class="anchor" aria-hidden="true" href="#by-length">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>by length
            </h4>
            <p>Another great feature since <code>m4b-tool</code> <em>v.0.4.0</em> is the
                <code>--max-chapter-length</code> parameter. Often the individual input files are too big which results
                in chapters with a very long duration. This can be annoying, if you would like to jump to a certain
                point, since you have to rewind or fast-forward and hold the button for a long time, instead of just
                tipping previous or next a few times. To automatically add sub-chapters, you could provide:</p>
            <p><code>--max-chapter-length=300,900</code></p>
            <p>This will cause <code>m4b-tool</code></p>
            <ul>
                <li>Trying to preserve original chapters as long as they are not longer than 15 minutes (900 seconds)
                </li>
                <li>If a track is longer than 15 minutes
                    <ul>
                        <li>Perform a silence detection and try to add sub-chapters at every silence every 5 minutes
                            (300 seconds)
                        </li>
                        <li>If no silence is detected, add a hard cut sub-chapter every 15 minutes</li>
                    </ul>
                </li>
            </ul>
            <p>Sub-chapters are named like the original and get an additional index. This is a nice way to keep the real
                names but not having chapters with a too long duration.</p>
            <h3>
                <a id="user-content-step-4-optional---for-ipod-owners" class="anchor" aria-hidden="true"
                   href="#step-4-optional---for-ipod-owners">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Step 4 (optional) - for iPod owners
            </h3>
            <p>If you own an iPod, there might be a problem with too long audiobooks, since iPods only support 32bit
                sampling rates. If your audiobook is longer than 27 hours with 22050Hz sampling rate, you could provide
                <code>--adjust-for-ipod</code>, to automatically downsample your audiobook, which results in lower
                quality, but at least its working on your good old iPod...</p>
            <h3>
                <a id="user-content-step-5---use-the---batch-pattern-feature" class="anchor" aria-hidden="true"
                   href="#step-5---use-the---batch-pattern-feature">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Step 5 - Use the <code>--batch-pattern</code> feature
            </h3>
            <p>In <code>m4b-tool v.0.4.0</code> the <code>--batch-pattern</code> feature was added. It can be used to
                batch-convert multiple audiobooks at once, but also to just convert one single audiobook - because you
                can create tags from an existing directory structure.</p>
            <blockquote>
                <p>Hint: The <code>output-file</code> parameter has to be a directory, when using
                    <code>--batch-pattern</code>.</p>
            </blockquote>
            <p>Even multiple <code>--batch-pattern</code> parameters are supported, while the first match will be used
                first. So if you created the directory structure as described above, the final command to merge <code>input/Fantasy/Harry
                    Potter/1 - Harry Potter and the Philosopher's Stone/</code> to <code>output/Fantasy/Harry Potter/1 -
                    Harry Potter and the Philosopher's Stone.m4b</code> would look like this:</p>
            <pre><code>m4b-tool merge -v --output-file="output/" --max-chapter-length=300,900 --adjust-for-ipod --batch-pattern="input/%g/%a/%s/%p - %n/"  --batch-pattern="input/%g/%a/%n/" "input/"
</code></pre>
            <blockquote>
                <p>In <code>--batch-pattern</code> mode, existing files are skipped by default</p>
            </blockquote>
            <h3>
                <a id="user-content-result" class="anchor" aria-hidden="true" href="#result">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Result
            </h3>
            <p>If you performed the above steps with the docker image or installed and compiled all dependencies, you
                should get the following result:</p>
            <ul>
                <li>Top quality audio by using <code>libfdk_aac</code> encoder</li>
                <li>Series and single audiobooks have valid tags for <code>genre</code>, <code>author</code>, <code>title</code>,
                    <code>sorttitle</code>, etc. from <code>--batch-pattern</code> usage
                </li>
                <li>If the files <code>cover.jpg</code> and <code>description.txt</code> exist in the main directories,
                    a <code>cover</code>, a <code>description</code> and a <code>longdesc</code> are embedded
                </li>
                <li>If you tagged the input files, real chapter names should appear in your player</li>
                <li>No more chapters longer than 15 minutes</li>
                <li>Working iPod versions for audiobooks longer than 27 hours</li>
            </ul>
            <h2>
                <a id="user-content-installation" class="anchor" aria-hidden="true" href="#installation">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Installation
            </h2>
            <h3>
                <a id="user-content-docker-experimental" class="anchor" aria-hidden="true" href="#docker-experimental">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Docker (experimental)
            </h3>
            <p>To use docker with <code>m4b-tool</code>, you first have to build a custom image located in the <code>docker</code>
                directory. Since this image is compiling every third party library from scratch to get the best possible
                audio quality, it can take a long time for the first build.</p>
            <pre><code># clone m4b-tool repository
git clone https://github.com/sandreas/m4b-tool.git

# change directory
cd m4b-tool

# build docker image - this will take a while
docker build docker -t m4b-tool

# create an alias for m4b-tool running docker
alias m4b-tool='docker run -it --rm -u $(id -u):$(id -g) -v "$(pwd)":/mnt m4b-tool'

# testing the command
m4b-tool --version
</code></pre>
            <blockquote>
                <p>Note: If you use the alias above, keep in mind that you cannot use absolute paths (e.g. <code>/tmp/data/audiobooks/harry
                    potter 1</code>) or symlinks. You must change into the directory and use relative paths (e.g. <code>cd
                    /tmp/data &amp;&amp; m4b-tool merge "audiobooks/harry potter 1" --output-file harry.m4b</code>)</p>
            </blockquote>
            <h3>
                <a id="user-content-macos" class="anchor" aria-hidden="true" href="#macos">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>MacOS
            </h3>
            <pre><code># install ffmpeg with best audio quality options
brew tap varenc/ffmpeg
brew tap-pin varenc/ffmpeg
brew uninstall ffmpeg
brew install ffmpeg --with-chromaprint --with-fdk-aac


# tap m4b-tool repository
brew tap sandreas/tap
brew tap-pin sandreas/tap

# install m4b-tool
brew install m4b-tool

# check installed m4b-tool version
m4b-tool --version
</code></pre>
            <h3>
                <a id="user-content-ubuntu" class="anchor" aria-hidden="true" href="#ubuntu">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Ubuntu
            </h3>
            <pre><code># install all dependencies
sudo apt install ffmpeg mp4v2-utils fdkaac php-cli

# install / upgrade m4b-tool
sudo wget https://github.com/sandreas/m4b-tool/releases/download/v.0.4.0/m4b-tool.phar -O /usr/local/bin/m4b-tool &amp;&amp; sudo chmod +x /usr/local/bin/m4b-tool

# check installed m4b-tool version 
m4b-tool --version
</code></pre>
            <blockquote>
                <p>Note: If you would like to get the <a href="#about-audio-quality">best possible audio quality</a>,
                    you have to compile <code>ffmpeg</code> with the high quality encoder <code>fdk-aac</code> (<code>--enable-libfdk_aac</code>)
                    - see <a href="https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu" rel="nofollow">https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu</a>
                    for a step-by-step guide to compile <code>ffmpeg</code>.</p>
            </blockquote>
            <h3>
                <a id="user-content-manual-installation-only-recommended-on-windows-systems" class="anchor"
                   aria-hidden="true" href="#manual-installation-only-recommended-on-windows-systems">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Manual installation (only recommended on Windows systems)
            </h3>
            <p><code>m4b-tool</code> is written in <code>PHP</code> and uses <code>ffmpeg</code>, <code>mp4v2</code> and
                optionally <code>fdkaac</code> for high efficiency codecs to perform conversions. Therefore you will
                need the following tools in your %PATH%:</p>
            <ul>
                <li>
                    <code>php</code> &gt;= 7.0 with <code>mbstring</code> extension enabled (<a href="https://php.net"
                                                                                                rel="nofollow">https://php.net</a>)
                </li>
                <li>
                    <code>ffmpeg</code> (<a href="https://www.ffmpeg.org" rel="nofollow">https://www.ffmpeg.org</a>)
                </li>
                <li>
                    <code>mp4v2</code> (<code>mp4chaps</code>, <code>mp4art</code>, etc. <a
                        href="https://github.com/sandreas/m4b-tool/releases/download/0.1/mp4v2-windows.zip">https://github.com/sandreas/m4b-tool/releases/download/0.1/mp4v2-windows.zip</a>)
                </li>
                <li>
                    <code>fdkaac</code> (optional, only if you need high efficiency for low bitrates &lt;= 32k, <a
                        href="http://wlc.io/2015/06/20/fdk-aac/" rel="nofollow">http://wlc.io/2015/06/20/fdk-aac/</a> -
                    caution: not official!)
                </li>
            </ul>
            <p>To check the dependencies, running following commands via command line should show similar output:</p>
            <pre><code>$ php -v
Copyright (c) 1997-2018 The PHP Group [...]

$ ffmpeg -version
ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers [...]

$ mp4chaps --version
mp4chaps - MP4v2 2.0.0

$ fdkaac
fdkaac 1.0.0 [...]

</code></pre>
            <p>If you are sure, all dependencies are installed, the next step is to download the latest release of
                <code>m4b-tool</code> from</p>
            <p><a href="https://github.com/sandreas/m4b-tool/releases">https://github.com/sandreas/m4b-tool/releases</a>
            </p>
            <p>Depending on the operating system, you can rename <code>m4b-tool.phar</code> to <code>m4b-tool</code> and
                run <code>m4b-tool --version</code> directly from the command line. If you are not sure, you can always
                use the command <code>php m4b-tool.phar --version</code> to check if the installation was successful.
                This should work on every system.</p>
            <p>If you would like to use the latest source code with all new features and fixes, you could also <a
                    href="#building-from-source">build from source</a>. The current build might be in unstable and
                should only be used for testing purposes or if you need a specific feature that has not been released.
            </p>
            <h3>
                <a id="user-content-custom-mp4v2-for-accurate-sorting-order" class="anchor" aria-hidden="true"
                   href="#custom-mp4v2-for-accurate-sorting-order">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Custom <code>mp4v2</code> for accurate sorting order
            </h3>
            <p>Most audiobooks are not released in alphabetical order. A prominent example is Harry Potter. So if you
                have all the Harry Potter audiobooks, it depends on your player, but probably they are not listed in the
                correct order... let's see, what the alphabetical order would be:</p>
            <ul>
                <li>Harry Potter and the Chamber of Secrets (Part 2)</li>
                <li>Harry Potter and the Philosopher's Stone (Part 1)</li>
                <li>Harry Potter and the Prisoner of Azkaban (Part 3)</li>
            </ul>
            <p>And the correct order would have been:</p>
            <ul>
                <li>Harry Potter and the Philosopher's Stone (Part 1)</li>
                <li>Harry Potter and the Chamber of Secrets (Part 2)</li>
                <li>Harry Potter and the Prisoner of Azkaban (Part 3)</li>
            </ul>
            <p>Well, there is a solution for this. You have to tag the audiobook with a custom <code>sortname</code> and
                / or <code>sortalbum</code>. If your player supports these tags, the order is now correct, even when the
                title is still the original title. To achieve this, i had to build a custom version of
                <code>mp4v2</code> (more accurate <code>mp4tags</code>), to add options for these tags and add the
                pseudo tags <code>--series</code> and <code>--series-part</code>.</p>
            <p>So if you do the following:</p>
            <pre><code>m4b-tool merge --name="Harry Potter and the Chamber of Secrets" --series="Harry Potter" --series-part="2" --output-file="output/Harry Potter and the Chamber of Secrets.m4b" "input/Harry Potter and the Chamber of Secrets"
</code></pre>
            <p>It would result in:</p>
            <ul>
                <li>Name: <code>Harry Potter and the Chamber of Secrets</code>
                </li>
                <li>Sortname: <code>Harry Potter 2 - Harry Potter and the Chamber of Secrets</code>
                </li>
            </ul>
            <h4>
                <a id="user-content-install-custom-mp4v2" class="anchor" aria-hidden="true"
                   href="#install-custom-mp4v2">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Install custom <code>mp4v2</code>
            </h4>
            <blockquote>
                <p>In the docker image, the custom version is already installed</p>
            </blockquote>
            <pre><code>git clone https://github.com/sandreas/mp4v2
cd mp4v2
./configure
make &amp;&amp; sudo make install
</code></pre>
            <h2>
                <a id="user-content-about-audio-quality" class="anchor" aria-hidden="true" href="#about-audio-quality">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>About audio quality
            </h2>
            <p>In <code>m4b-tool</code> all audio conversions are performed with <code>ffmpeg</code> resulting in pretty
                descent audio quality using its free encoders. However, best quality takes some extra effort, so if you
                are using the free encoders, <code>m4b-tool</code> might show the following hint:</p>
            <blockquote>
                <p>Your ffmpeg version cannot produce top quality aac using encoder aac instead of libfdk_aac</p>
            </blockquote>
            <p>That's not really a problem, because the difference between the <code>aac</code> and
                <code>libfdk_aac</code> encoder is hardly noticeable in most cases. But to overcome the hint and get the
                best audio quality possible, you have to use a non-free encoder, that is not integrated in
                <code>ffmpeg</code> by default (licensing reasons).
                Depending on the operating system you are using, installing the non-free encoder may require a little
                extra skills, effort and time (see the notes for your operating system above).
                You have to decide, if it is worth the additional effort for getting the slightly better quality. If you
                are using the docker image, you should get the best quality by default.</p>
            <p>If you are using very low bitrates (&lt;= 32k), you could also use high efficiency profiles to further
                improve audio quality (e.g. <code>--audio-profile=aac_he</code> for mono). Unfortunately,
                <code>ffmpeg</code>'s high efficiency implementation produces audio files, that are incompatible with
                many players (including iTunes). To produce high efficiency files, that are compatible with at least
                most common players, you will need to install <code>fdkaac</code> for now.</p>
            <p>More Details:</p>
            <ul>
                <li><a href="https://github.com/sandreas/m4b-tool/issues/19">https://github.com/sandreas/m4b-tool/issues/19</a>
                </li>
                <li><a href="https://trac.ffmpeg.org/wiki/Encode/AAC" rel="nofollow">https://trac.ffmpeg.org/wiki/Encode/AAC</a>
                </li>
                <li><a href="https://trac.ffmpeg.org/wiki/Encode/HighQualityAudio" rel="nofollow">https://trac.ffmpeg.org/wiki/Encode/HighQualityAudio</a>
                </li>
            </ul>
            <h1>
                <a id="user-content-submitting-issues" class="anchor" aria-hidden="true" href="#submitting-issues">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Submitting issues
            </h1>
            <p>You think there is an issue with <code>m4b-tool</code>? First take a look at the <a href="#known-issues">Known
                Issues</a> below. If this does not help, please provide the following information when adding an issue:
            </p>
            <ul>
                <li>the operating system you use</li>
                <li>the exact command, that you tried, e.g. <code>m4b-tool merge my-audio-book/ --output-file
                    merged.m4b</code>
                </li>
                <li>the error message, that occured or the circumstances, e.g. <code>the resulting file merged.m4b is
                    only 5kb</code>
                </li>
                <li>other relevant information, e.g. sample files if needed</li>
            </ul>
            <blockquote>
                <p>Example:</p>
            </blockquote>
            <pre><code>Title: m4b-tool does not embed covers

If i run m4b-tool with a folder containing a cover.png, it does not embed the cover and shows an error message.

OS: Ubuntu 16.04 LTS
Command: `m4b-tool merge my-audio-book/ ---output-file merged.m4b`
Error: Cannot embed cover, cover is not a valid image file

Attached files: cover.png
</code></pre>
            <h2>
                <a id="user-content-known-issues" class="anchor" aria-hidden="true" href="#known-issues">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Known issues
            </h2>
            <p>If you are getting PHP Exceptions, it is a configuration issue with PHP in most cases. If are not
                familiar with PHP configuration,
                you could follow these instructions, to fix a few known issues:</p>
            <h3>
                <a id="user-content-exception-charset-not-supported" class="anchor" aria-hidden="true"
                   href="#exception-charset-not-supported">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Exception Charset not supported
            </h3>
            <pre><code>[Exception]
  charset windows-1252 is not supported - use one of these instead: utf-8
</code></pre>
            <p>This mostly happens on windows, because the <code>mbstring</code>-Extension is used to internally convert
                charsets, so that special chars like german umlauts
                are supported on every platform. To fix this, you need to enable the mbstring-extension:</p>
            <p>Run <code>php --ini</code> on the command line:</p>
            <pre><code>C:\&gt;php --ini
...
Loaded Configuration File:         C:\Program Files\php\php.ini
</code></pre>
            <p>Open the configuration file (e.g. <code>C:\Program Files\php\php.ini</code>) in a text editor and search
                for <code>extension=</code>. On Windows there should be an item like this:</p>
            <pre><code>;extension=php_mbstring.dll
</code></pre>
            <p>remove the <code>;</code> to enable the extension:</p>
            <pre><code>extension=php_mbstring.dll
</code></pre>
            <p>Now everything should work as expected.</p>
            <h1>
                <a id="user-content-m4b-tool-commands" class="anchor" aria-hidden="true" href="#m4b-tool-commands">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>m4b-tool commands
            </h1>
            <p>The following list contains all possible commands including <a href="#merge"><code>merge</code></a>, <a
                    href="#split"><code>split</code></a> and <a href="#chapters"><code>chapters</code></a> accompanied
                by the reference of parameters available in every command.</p>
            <h2>
                <a id="user-content-merge" class="anchor" aria-hidden="true" href="#merge">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>merge
            </h2>
            <p>With <code>m4b-tool</code> you can merge a set of audio files to one single m4b audiobook file.</p>
            <h3>
                <a id="user-content-example" class="anchor" aria-hidden="true" href="#example">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Example:
            </h3>
            <pre><code>m4b-tool merge "data/my-audio-book" --output-file="data/my-audio-book.m4b"
</code></pre>
            <p>This merges all Audio-Files in folder <code>data/my-audio-book</code> into <code>my-audio-book.m4b</code>,
                using
                the tag-title of every file for generating chapters.</p>
            <p>If there is a file <code>data/my-audio-book/cover.jpg</code>, it will be used as cover for the resulting
                m4b file.</p>
            <p><em><strong>Note</strong></em> If you use untagged audio files, you could provide a musicbrainz id to get
                the correct chapter names, see command <a href="#chapters">chapter</a> for more info.</p>
            <h3>
                <a id="user-content-reference" class="anchor" aria-hidden="true" href="#reference">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Reference
            </h3>
            <p>For all options, see <code>m4b-tool merge --help</code>:</p>
            <pre><code>Description:
  Merges a set of files to one single file

Usage:
  merge [options] [--] &lt;input&gt; [&lt;more-input-files&gt;...]

Arguments:
  input                                          Input file or folder
  more-input-files                               Other Input files or folders

Options:
      --logfile[=LOGFILE]                        file to dump all output [default: ""]
      --debug                                    enable debug mode - sets verbosity to debug, logfile to m4b-tool.log and temporary files are not deleted
  -f, --force                                    force overwrite of existing files
      --no-cache                                 do not use cached values and clear cache completely
      --ffmpeg-threads[=FFMPEG-THREADS]          specify -threads parameter for ffmpeg [default: ""]
      --platform-charset[=PLATFORM-CHARSET]      Convert from this filesystem charset to utf-8, when tagging files (e.g. Windows-1252, mainly used on Windows Systems) [default: ""]
      --ffmpeg-param[=FFMPEG-PARAM]              Add argument to every ffmpeg call, append after all other ffmpeg parameters (e.g. --ffmpeg-param="-max_muxing_queue_size" --ffmpeg-param="1000" for ffmpeg [...] -max_muxing_queue_size 1000) (multiple values allowed)
  -a, --silence-min-length[=SILENCE-MIN-LENGTH]  silence minimum length in milliseconds [default: 1750]
  -b, --silence-max-length[=SILENCE-MAX-LENGTH]  silence maximum length in milliseconds [default: 0]
      --max-chapter-length[=MAX-CHAPTER-LENGTH]  maximum chapter length in seconds - its also possible to provide a desired chapter length in form of 300,900 where 300 is desired and 900 is max - if the max chapter length is exceeded, the chapter is placed on the first silence between desired and max chapter length [default: "0"]
      --audio-format[=AUDIO-FORMAT]              output format, that ffmpeg will use to create files [default: "m4b"]
      --audio-channels[=AUDIO-CHANNELS]          audio channels, e.g. 1, 2 [default: ""]
      --audio-bitrate[=AUDIO-BITRATE]            audio bitrate, e.g. 64k, 128k, ... [default: ""]
      --audio-samplerate[=AUDIO-SAMPLERATE]      audio samplerate, e.g. 22050, 44100, ... [default: ""]
      --audio-codec[=AUDIO-CODEC]                audio codec, e.g. libmp3lame, aac, ... [default: ""]
      --audio-profile[=AUDIO-PROFILE]            audio profile, when using extra low bitrate - valid values (mono, stereo): aac_he, aac_he_v2  [default: ""]
      --adjust-for-ipod                          auto adjust bitrate and sampling rate for ipod, if track is to long (may lead to poor quality)
      --name[=NAME]                              provide a custom audiobook name, otherwise the existing metadata will be used [default: ""]
      --sortname[=SORTNAME]                      provide a custom audiobook name, that is used only for sorting purposes [default: ""]
      --album[=ALBUM]                            provide a custom audiobook album, otherwise the existing metadata for name will be used [default: ""]
      --sortalbum[=SORTALBUM]                    provide a custom audiobook album, that is used only for sorting purposes [default: ""]
      --artist[=ARTIST]                          provide a custom audiobook artist, otherwise the existing metadata will be used [default: ""]
      --sortartist[=SORTARTIST]                  provide a custom audiobook artist, that is used only for sorting purposes [default: ""]
      --genre[=GENRE]                            provide a custom audiobook genre, otherwise the existing metadata will be used [default: ""]
      --writer[=WRITER]                          provide a custom audiobook writer, otherwise the existing metadata will be used [default: ""]
      --albumartist[=ALBUMARTIST]                provide a custom audiobook albumartist, otherwise the existing metadata will be used [default: ""]
      --year[=YEAR]                              provide a custom audiobook year, otherwise the existing metadata will be used [default: ""]
      --cover[=COVER]                            provide a custom audiobook cover, otherwise the existing metadata will be used
      --description[=DESCRIPTION]                provide a custom audiobook short description, otherwise the existing metadata will be used
      --longdesc[=LONGDESC]                      provide a custom audiobook long description, otherwise the existing metadata will be used
      --comment[=COMMENT]                        provide a custom audiobook comment, otherwise the existing metadata will be used
      --copyright[=COPYRIGHT]                    provide a custom audiobook copyright, otherwise the existing metadata will be used
      --encoded-by[=ENCODED-BY]                  provide a custom audiobook encoded-by, otherwise the existing metadata will be used
      --series[=SERIES]                          provide a custom audiobook series, this pseudo tag will be used to auto create sort order (e.g. Harry Potter or The Kingkiller Chronicles)
      --series-part[=SERIES-PART]                provide a custom audiobook series part, this pseudo tag will be used to auto create sort order (e.g. 1 or 2.5)
      --skip-cover                               skip extracting and embedding covers
      --fix-mime-type                            try to fix MIME-type (e.g. from video/mp4 to audio/mp4) - this is needed for some players to prevent video window
  -o, --output-file=OUTPUT-FILE                  output file
      --include-extensions[=INCLUDE-EXTENSIONS]  comma separated list of file extensions to include (others are skipped) [default: "aac,alac,flac,m4a,m4b,mp3,oga,ogg,wav,wma,mp4"]
  -m, --musicbrainz-id=MUSICBRAINZ-ID            musicbrainz id so load chapters from
      --mark-tracks                              add chapter marks for each track
      --no-conversion                            skip conversion (destination file uses same encoding as source - all encoding specific options will be ignored)
      --batch-pattern[=BATCH-PATTERN]            multiple batch patterns that can be used to merge all audio books in a directory matching the given patterns (e.g. %a/%t for author/title) (multiple values allowed)
      --dry-run                                  perform a dry run without converting all the files in batch mode (requires --batch-pattern)
      --jobs[=JOBS]                              Specifies the number of jobs (commands) to run simultaneously [default: 1]
  -h, --help                                     Display this help message
  -q, --quiet                                    Do not output any message
  -V, --version                                  Display this application version
      --ansi                                     Force ANSI output
      --no-ansi                                  Disable ANSI output
  -n, --no-interaction                           Do not ask any interactive question
  -v|vv|vvv, --verbose                           Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
</code></pre>
            <h3>
                <a id="user-content-placeholder-reference-for---batch-pattern" class="anchor" aria-hidden="true"
                   href="#placeholder-reference-for---batch-pattern">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Placeholder reference for <code>--batch-pattern</code>
            </h3>
            <p>If you use the <code>--batch-pattern</code> parameter, the following placeholders are supported</p>
            <ul>
                <li>
                    <code>title</code> / <code>name</code>: <code>%n</code>
                </li>
                <li>
                    <code>sort_name</code>: <code>%N</code>
                </li>
                <li>
                    <code>album</code>: <code>%m</code>,
                </li>
                <li>
                    <code>sort_album</code>: <code>%m</code>,
                </li>
                <li>
                    <code>artist</code>: <code>%a</code>,
                </li>
                <li>
                    <code>sort_artist</code>: <code>%a</code>,
                </li>
                <li>
                    <code>genre</code>: <code>%g</code>,
                </li>
                <li>
                    <code>writer</code>: <code>%w</code>,
                </li>
                <li>
                    <code>album_artist</code>: <code>%t</code>,
                </li>
                <li>
                    <code>year</code>: <code>%y</code>,
                </li>
                <li>
                    <code>description</code>: <code>%d</code>,
                </li>
                <li>
                    <code>long_description</code>: <code>%d</code>,
                </li>
                <li>
                    <code>comment</code>: <code>%c</code>,
                </li>
                <li>
                    <code>copyright</code>: <code>%c</code>,
                </li>
                <li>
                    <code>encoded_by</code>: <code>%e</code>,
                </li>
                <li>
                    <code>series</code>: <code>%s</code>,
                </li>
                <li>
                    <code>series_part</code>: <code>%p</code>,
                </li>
            </ul>
            <h2>
                <a id="user-content-split" class="anchor" aria-hidden="true" href="#split">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>split
            </h2>
            <p><code>m4b-tool</code> can be used to split a single m4b into a file per chapter.</p>
            <h3>
                <a id="user-content-example-1" class="anchor" aria-hidden="true" href="#example-1">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Example:
            </h3>
            <pre><code>m4b-tool split --audio-format mp3 --audio-bitrate 96k --audio-channels 1 --audio-samplerate 22050 "data/my-audio-book.m4b"
</code></pre>
            <p>This splits the file <code>data/my-audio-book.m4b into</code> an mp3 file for each chapter, writing the
                files into <code>data/my-audio-book_splitted/</code>.</p>
            <h3>
                <a id="user-content-reference-1" class="anchor" aria-hidden="true" href="#reference-1">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Reference
            </h3>
            <p>For all options, see <code>m4b-tool split --help</code>:</p>
            <pre><code>Description:
  Splits an m4b file into parts

Usage:
  split [options] [--] &lt;input&gt;

Arguments:
  input                                          Input file or folder

Options:
      --logfile[=LOGFILE]                        file to dump all output [default: ""]
      --debug                                    enable debug mode - sets verbosity to debug, logfile to m4b-tool.log and temporary files are not deleted
  -f, --force                                    force overwrite of existing files
      --no-cache                                 do not use cached values and clear cache completely
      --ffmpeg-threads[=FFMPEG-THREADS]          specify -threads parameter for ffmpeg [default: ""]
      --platform-charset[=PLATFORM-CHARSET]      Convert from this filesystem charset to utf-8, when tagging files (e.g. Windows-1252, mainly used on Windows Systems) [default: ""]
      --ffmpeg-param[=FFMPEG-PARAM]              Add argument to every ffmpeg call, append after all other ffmpeg parameters (e.g. --ffmpeg-param="-max_muxing_queue_size" --ffmpeg-param="1000" for ffmpeg [...] -max_muxing_queue_size 1000) (multiple values allowed)
  -a, --silence-min-length[=SILENCE-MIN-LENGTH]  silence minimum length in milliseconds [default: 1750]
  -b, --silence-max-length[=SILENCE-MAX-LENGTH]  silence maximum length in milliseconds [default: 0]
      --max-chapter-length[=MAX-CHAPTER-LENGTH]  maximum chapter length in seconds - its also possible to provide a desired chapter length in form of 300,900 where 300 is desired and 900 is max - if the max chapter length is exceeded, the chapter is placed on the first silence between desired and max chapter length [default: "0"]
      --audio-format[=AUDIO-FORMAT]              output format, that ffmpeg will use to create files [default: "m4b"]
      --audio-channels[=AUDIO-CHANNELS]          audio channels, e.g. 1, 2 [default: ""]
      --audio-bitrate[=AUDIO-BITRATE]            audio bitrate, e.g. 64k, 128k, ... [default: ""]
      --audio-samplerate[=AUDIO-SAMPLERATE]      audio samplerate, e.g. 22050, 44100, ... [default: ""]
      --audio-codec[=AUDIO-CODEC]                audio codec, e.g. libmp3lame, aac, ... [default: ""]
      --audio-profile[=AUDIO-PROFILE]            audio profile, when using extra low bitrate - valid values (mono, stereo): aac_he, aac_he_v2  [default: ""]
      --adjust-for-ipod                          auto adjust bitrate and sampling rate for ipod, if track is to long (may lead to poor quality)
      --name[=NAME]                              provide a custom audiobook name, otherwise the existing metadata will be used [default: ""]
      --sortname[=SORTNAME]                      provide a custom audiobook name, that is used only for sorting purposes [default: ""]
      --album[=ALBUM]                            provide a custom audiobook album, otherwise the existing metadata for name will be used [default: ""]
      --sortalbum[=SORTALBUM]                    provide a custom audiobook album, that is used only for sorting purposes [default: ""]
      --artist[=ARTIST]                          provide a custom audiobook artist, otherwise the existing metadata will be used [default: ""]
      --sortartist[=SORTARTIST]                  provide a custom audiobook artist, that is used only for sorting purposes [default: ""]
      --genre[=GENRE]                            provide a custom audiobook genre, otherwise the existing metadata will be used [default: ""]
      --writer[=WRITER]                          provide a custom audiobook writer, otherwise the existing metadata will be used [default: ""]
      --albumartist[=ALBUMARTIST]                provide a custom audiobook albumartist, otherwise the existing metadata will be used [default: ""]
      --year[=YEAR]                              provide a custom audiobook year, otherwise the existing metadata will be used [default: ""]
      --cover[=COVER]                            provide a custom audiobook cover, otherwise the existing metadata will be used
      --description[=DESCRIPTION]                provide a custom audiobook short description, otherwise the existing metadata will be used
      --longdesc[=LONGDESC]                      provide a custom audiobook long description, otherwise the existing metadata will be used
      --comment[=COMMENT]                        provide a custom audiobook comment, otherwise the existing metadata will be used
      --copyright[=COPYRIGHT]                    provide a custom audiobook copyright, otherwise the existing metadata will be used
      --encoded-by[=ENCODED-BY]                  provide a custom audiobook encoded-by, otherwise the existing metadata will be used
      --series[=SERIES]                          provide a custom audiobook series, this pseudo tag will be used to auto create sort order (e.g. Harry Potter or The Kingkiller Chronicles)
      --series-part[=SERIES-PART]                provide a custom audiobook series part, this pseudo tag will be used to auto create sort order (e.g. 1 or 2.5)
      --skip-cover                               skip extracting and embedding covers
      --fix-mime-type                            try to fix MIME-type (e.g. from video/mp4 to audio/mp4) - this is needed for some players to prevent video window
  -o, --output-dir[=OUTPUT-DIR]                  output directory [default: ""]
  -p, --filename-template[=FILENAME-TEMPLATE]    filename twig-template for output file naming [default: "{{\"%03d\"|format(track)}}-{{title}}"]
      --use-existing-chapters-file               use an existing manually edited chapters file &lt;audiobook-name&gt;.chapters.txt instead of embedded chapters for splitting
  -h, --help                                     Display this help message
  -q, --quiet                                    Do not output any message
  -V, --version                                  Display this application version
      --ansi                                     Force ANSI output
      --no-ansi                                  Disable ANSI output
  -n, --no-interaction                           Do not ask any interactive question
  -v|vv|vvv, --verbose                           Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  Split an m4b into multiple m4b or mp3 files by chapter
</code></pre>
            <h3>
                <a id="user-content-filename-template-reference" class="anchor" aria-hidden="true"
                   href="#filename-template-reference">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>filename-template reference
            </h3>
            <p>If you would like to use a custom filename template, the <a href="https://twig.symfony.com/"
                                                                           rel="nofollow">Twig</a> template engine is
                provided. The following variables are available:</p>
            <pre><code>{{encoder}}
{{title}}           
{{artist}}          
{{genre}}
{{writer}}
{{album}}
{{disk}}
{{disks}}
{{albumArtist}}
{{year}}
{{track}}
{{tracks}}
{{cover}}
{{description}}
{{longDescription}}
{{comment}}
{{copyright}}
{{encodedBy}}
</code></pre>
            <ul>
                <li>You can also use some Twig specific template extensions to pad or reformat these values. The default
                    template is <code>{{\"%03d\"|format(track)}}-{{title}}</code>, which results in filenames like
                    <code>001-mychapter</code>
                </li>
                <li>Slashes are interpreted as directory separators, so if you use a template <code>{{year}}/{{artist}}/{{title}}</code>
                    the resulting directory and file is <code>2018/Joanne K. Rowling/Harry Potter 1</code>
                </li>
                <li>It is not recommended to use <code>{{description}}</code> or <code>{{longdescription}}</code> for
                    filenames but they are also provided, if the field contains other information than intended
                </li>
                <li>Special chars, that are forbidden in filenames are removed automatically</li>
            </ul>
            <h2>
                <a id="user-content-chapters" class="anchor" aria-hidden="true" href="#chapters">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>chapters
            </h2>
            <p>Many m4b audiobook files do not contain valid chapters for different reasons. <code>m4b-tool</code> can
                handle two cases:</p>
            <ul>
                <li>Correct misplaced chapters by silence detection</li>
                <li>Add chapters from an internet source (mostly for well known titles)</li>
            </ul>
            <h3>
                <a id="user-content-misplaced-chapters" class="anchor" aria-hidden="true" href="#misplaced-chapters">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Misplaced chapters
            </h3>
            <p>In some cases there is a shift between the chapter mark and the real beginning of a chapter. <code>m4b-tool</code>
                could try
                to correct that by detecting silences and relocating the chapter to the nearest silence:</p>
            <pre><code>m4b-tool chapters --adjust-by-silence -o "data/destination-with-adjusted-chapters.m4b" "data/source-with-misplaced-chapters.m4b"
</code></pre>
            <p>It won't work, if the shift is to large or if the chapters are strongly misplaced, but since everything
                is done automatically, it's worth a try, isn't it?</p>
            <h3>
                <a id="user-content-no-chapters-at-all" class="anchor" aria-hidden="true" href="#no-chapters-at-all">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>No chapters at all
            </h3>
            <p>If you have a well known audiobook, like <em><strong>Harry Potter and the Philosopher’s
                Stone</strong></em>,
                you might be lucky that it is on musicbrainz.</p>
            <p>In this case <code>m4b-tool</code> can try to correct the chapter information using silence
                detection and the musicbrainz data.</p>
            <p>Since this is not a trivial task and prone to error, <code>m4b-tool</code> offers some parameters to
                correct
                misplaced chapter positions manually.</p>
            <h3>
                <a id="user-content-a-typical-workflow" class="anchor" aria-hidden="true" href="#a-typical-workflow">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>A typical workflow
            </h3>
            <h4>
                <a id="user-content-getting-the-musicbrainz-id" class="anchor" aria-hidden="true"
                   href="#getting-the-musicbrainz-id">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Getting the musicbrainz id
            </h4>
            <p>You have to find the exact musicbrainz id:</p>
            <ul>
                <li>An easy way to find the book is to use the authors name or the readers name to search for it</li>
                <li>Once you found the book of interest, click on the list entry to show further information</li>
                <li>To get the musicbrainz id, open the <em><strong>details</strong></em> page and find the MBID (e.g.
                    <code>8669da33-bf9c-47fe-adc9-23798a37b096</code>)
                </li>
            </ul>
            <p>Example: <a href="https://musicbrainz.org/work/8669da33-bf9c-47fe-adc9-23798a37b096" rel="nofollow">https://musicbrainz.org/work/8669da33-bf9c-47fe-adc9-23798a37b096</a>
            </p>
            <pre><code>MBID: 8669da33-bf9c-47fe-adc9-23798a37b096
</code></pre>
            <h4>
                <a id="user-content-finding-main-chapters" class="anchor" aria-hidden="true"
                   href="#finding-main-chapters">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Finding main chapters
            </h4>
            <p>After getting the MBID you should find the main chapter points (where the name of the current chapter
                name is read aloud by the author).</p>
            <pre><code>m4b-tool chapters --merge-similar --first-chapter-offset 4000 --last-chapter-offset 3500 -m 8669da33-bf9c-47fe-adc9-23798a37b096 "../data/harry-potter-1.m4b"
</code></pre>
            <p>Explanation:</p>
            <ul>
                <li>
                    <code>--merge-similar</code>: merges all similar chapters (e.g. <em><strong>The Boy Who Lived, Part
                    1</strong></em> and <em><strong>The Boy Who Lived, Part 2</strong></em> will be merged to
                    <em><strong>The Boy Who Lived</strong></em>)
                </li>
                <li>
                    <code>--first-chapter-offset</code>: creates an start offset chapter called <em><strong>Offset First
                    Chapter</strong></em> with a length of 4 seconds for skipping intros (e.g. audible, etc.)
                </li>
                <li>
                    <code>--last-chapter-offset</code>: creates an end offset chapter called <em><strong>Offset Last
                    Chapter</strong></em> with a length of 3,5 seconds for skipping outros (e.g. audible, etc.)
                </li>
                <li>
                    <code>-m</code>: MBID
                </li>
            </ul>
            <h4>
                <a id="user-content-finding-misplaced-main-chapters" class="anchor" aria-hidden="true"
                   href="#finding-misplaced-main-chapters">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Finding misplaced main chapters
            </h4>
            <p>Now listen to the audiobook an go through the chapters. Lets assume, all but 2 chapters were detected
                correctly.
                The two misplaced chapters are chapter number 6 and 9.</p>
            <p>To find the real position of chapters 6 and 9 invoke:</p>
            <pre><code>m4b-tool chapter --find-misplaced-chapters 5,8  --merge-similar --first-chapter-offset 4000 --last-chapter-offset 3500 -m 8669da33-bf9c-47fe-adc9-23798a37b096 "../data/harry-potter-1.m4b"
</code></pre>
            <p>Explanation:
                <code>--find-misplaced-chapters</code>: Comma separated list of chapter numbers, that were not detected
                correctly.</p>
            <p>Now <code>m4b-tool</code> will generate a <em><strong>potential chapter</strong></em> for every silence
                around the used chapter mark to find the right chapter position.</p>
            <p>Listen to the audiobook again and find the right chapter position. Note them down.</p>
            <h4>
                <a id="user-content-manually-adjust-misplaced-chapters" class="anchor" aria-hidden="true"
                   href="#manually-adjust-misplaced-chapters">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Manually adjust misplaced chapters
            </h4>
            <p>Next run the full chapter detection with the --no-chapter-import option, which prevents writing the
                chapters directly to the file.</p>
            <pre><code>m4b-tool chapter --no-chapter-import --first-chapter-offset 4000 --last-chapter-offset 3500 -m 8669da33-bf9c-47fe-adc9-23798a37b096 "../data/harry-potter-1.m4b"
</code></pre>
            <p>To Adjust misplaced chapters, do the following:</p>
            <ul>
                <li>Change the start position of all misplaced chapters manually in the file <code>../data/harry-potter-1.chapters.txt</code>
                </li>
                <li>Import the corrected chapters with <code>mp4chaps -i ../data/harry-potter-1.m4b</code>
                </li>
            </ul>
            <p>Listen to <code>harry-potter-1.m4b</code> again, now the chapters should be at the correct position.</p>
            <h4>
                <a id="user-content-troubleshooting" class="anchor" aria-hidden="true" href="#troubleshooting">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Troubleshooting
            </h4>
            <p>If none of the chapters are detected correctly, this can have different reasons:</p>
            <ul>
                <li>The silence parts of this audiobook are too short for detection. To adjust the minimum silence
                    length, use <code>--silence-min-length 1000</code> setting the silence length to 1 second.
                    <ul>
                        <li>Caution: To low values can lead to misplaced chapters and increased detection time.</li>
                    </ul>
                </li>
                <li>You provided the wrong MBID</li>
                <li>There is too much background noise in this specific audiobook, so that silences cannot be detected
                </li>
            </ul>
            <h4>
                <a id="user-content-reference-2" class="anchor" aria-hidden="true" href="#reference-2">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Reference
            </h4>
            <p>For all options, see <code>m4b-tool chapters --help</code>:</p>
            <pre><code>Description:
  Adds chapters to m4b file

Usage:
  chapters [options] [--] &lt;input&gt;

Arguments:
  input                                                      Input file or folder

Options:
      --logfile[=LOGFILE]                                    file to dump all output [default: ""]
      --debug                                                enable debug mode - sets verbosity to debug, logfile to m4b-tool.log and temporary files are not deleted
  -f, --force                                                force overwrite of existing files
      --no-cache                                             do not use cached values and clear cache completely
      --ffmpeg-threads[=FFMPEG-THREADS]                      specify -threads parameter for ffmpeg [default: ""]
      --platform-charset[=PLATFORM-CHARSET]                  Convert from this filesystem charset to utf-8, when tagging files (e.g. Windows-1252, mainly used on Windows Systems) [default: ""]
      --ffmpeg-param[=FFMPEG-PARAM]                          Add argument to every ffmpeg call, append after all other ffmpeg parameters (e.g. --ffmpeg-param="-max_muxing_queue_size" --ffmpeg-param="1000" for ffmpeg [...] -max_muxing_queue_size 1000) (multiple values allowed)
  -a, --silence-min-length[=SILENCE-MIN-LENGTH]              silence minimum length in milliseconds [default: 1750]
  -b, --silence-max-length[=SILENCE-MAX-LENGTH]              silence maximum length in milliseconds [default: 0]
      --max-chapter-length[=MAX-CHAPTER-LENGTH]              maximum chapter length in seconds - its also possible to provide a desired chapter length in form of 300,900 where 300 is desired and 900 is max - if the max chapter length is exceeded, the chapter is placed on the first silence between desired and max chapter length [default: "0"]
  -m, --musicbrainz-id=MUSICBRAINZ-ID                        musicbrainz id so load chapters from
  -s, --merge-similar                                        merge similar chapter names
  -o, --output-file[=OUTPUT-FILE]                            write chapters to this output file [default: ""]
      --adjust-by-silence                                    will try to adjust chapters of a file by silence detection and existing chapter marks
      --find-misplaced-chapters[=FIND-MISPLACED-CHAPTERS]    mark silence around chapter numbers that where not detected correctly, e.g. 8,15,18 [default: ""]
      --find-misplaced-offset[=FIND-MISPLACED-OFFSET]        mark silence around chapter numbers with this offset seconds maximum [default: 120]
      --find-misplaced-tolerance[=FIND-MISPLACED-TOLERANCE]  mark another chapter with this offset before each silence to compensate ffmpeg mismatches [default: -4000]
      --no-chapter-numbering                                 do not append chapter number after name, e.g. My Chapter (1)
      --no-chapter-import                                    do not import chapters into m4b-file, just create chapters.txt
      --chapter-pattern[=CHAPTER-PATTERN]                    regular expression for matching chapter name [default: "/^[^:]+[1-9][0-9]*:[\s]*(.*),.*[1-9][0-9]*[\s]*$/i"]
      --chapter-replacement[=CHAPTER-REPLACEMENT]            regular expression replacement for matching chapter name [default: "$1"]
      --chapter-remove-chars[=CHAPTER-REMOVE-CHARS]          remove these chars from chapter name [default: "„“”"]
      --first-chapter-offset[=FIRST-CHAPTER-OFFSET]          milliseconds to add after silence on chapter start [default: 0]
      --last-chapter-offset[=LAST-CHAPTER-OFFSET]            milliseconds to add after silence on chapter start [default: 0]
  -h, --help                                                 Display this help message
  -q, --quiet                                                Do not output any message
  -V, --version                                              Display this application version
      --ansi                                                 Force ANSI output
      --no-ansi                                              Disable ANSI output
  -n, --no-interaction                                       Do not ask any interactive question
  -v|vv|vvv, --verbose                                       Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  Can add Chapters to m4b files via different types of inputs
</code></pre>
            <h1>
                <a id="user-content-building-from-source" class="anchor" aria-hidden="true"
                   href="#building-from-source">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Building from source
            </h1>
            <p><code>m4b-tool</code> contains a <code>build</code> script, which will create an executable m4b-tool.phar
                in the dist folder. Composer for PHP
                is required, so after installing composer, run following commands in project root folder:</p>
            <h2>
                <a id="user-content-linux--unix" class="anchor" aria-hidden="true" href="#linux--unix">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Linux / Unix
            </h2>
            <h3>
                <a id="user-content-install-dependencies-ubuntu" class="anchor" aria-hidden="true"
                   href="#install-dependencies-ubuntu">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Install Dependencies (Ubuntu)
            </h3>
            <div class="highlight highlight-source-shell">
                <pre>sudo apt install ffmpeg mp4v2-utils fdkaac php-cli composer phpunit php-mbstring</pre>
            </div>
            <h3>
                <a id="user-content-build" class="anchor" aria-hidden="true" href="#build">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Build
            </h3>
            <pre><code>composer update
./build
</code></pre>
            <h2>
                <a id="user-content-windows" class="anchor" aria-hidden="true" href="#windows">
                    <svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16"
                         aria-hidden="true">
                        <path fill-rule="evenodd"
                              d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
                    </svg>
                </a>Windows
            </h2>
            <pre><code>composer update
build
</code></pre>
        </article>

    </div>
    <a name="contact"></a>
    <div class="imprint">
        <h1>Contact</h1>
        <address>
            <p class="fy-name">Andreas Fuhrich</p>
            <span class="fy-street-address">Schröderstr. 32</span><br>
            <span class="fy-postal-code">69120</span> <span class="town">Heidelberg</span><br>
            <span class="fy-region">Baden-Württemberg</span><br>
            <span class="fy-country-name">Germany</span>
            <p>Send me an email: <img src="https://fynder.de/img/imprint/email.svg" height="14" alt="e-mail"></p>
            <p>Or open an issue: <a href="https://github.com/sandreas/m4b-tool/issues">https://github.com/sandreas/m4b-tool/issues</a>
            </p>
        </address>
    </div>
</main>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/popper.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.2.1/js/bootstrap.min.js"></script>
</body>
</html>
